<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        var name = '222';
        var a = {
            name: '111',
            say: function() {
                console.log(this.name);
            }
        }
        var fun = a.say;
        fun();  // 指向window
        a.say(); // 谁调用指向谁


        var b = {
            name: '333',
            say: function(fun) {
                console.log(this);// this指向b，b调用的say
                fun(); //执行函数，创建新的AO，里面this是window
            }
        }
        b.say(a.say); // 预编译环节，this指向window
        b.say = a.say;
        b.say(); // 谁调用指向谁


    </script>
</body>
</html>